//: C04:Sbufget.cpp
// Copies a file to standard output.
#include "../require.h"
#include <fstream>
#include <iostream>
#include <streambuf>
using namespace std;

int main(void) {
  ifstream in("Sbufget.cpp");
  assure(in);
  streambuf &sb = *cout.rdbuf();
  while (!in.get(sb).eof()) {
    if (in.fail()) {
      // Found blank line
      in.clear();
    }
    cout << char(in.get()); // Process '\n'
  }
}